package tree;

import hxd.Pixels.Flags;
import haxe.ds.GenericStack;

//根节点
class Root extends Tress {
    private static var m_instance : Root;
    public static function GetInstance() : Root {
        if(m_instance == null){
            m_instance = new Root();
        }
        return m_instance;
    }
    private var m_cmdStack : GenericStack<LeafCmd>;
    
    public function new() {
        super();
        m_cmdStack = new GenericStack<LeafCmd>();
    }

    //添加命令
    public function AddLeafCmd(cmd:LeafCmd) {
        m_cmdStack.add(cmd);
    }
    
    //刷新
    public function Update(dt:Float) {
        OnUpdate(m_cmdStack.pop());
    }
    
}